#define _CRT_SECURE_NO_WARNINGS	

#include<stdio.h>

int main()
{
    int k;
    scanf("%d", &k);
    if (k < 1)
        printf("Error\n");
    else
    {
        int a = 1;
        int b = 2;
        int c = 0;
        if (k == 1)
            printf("1");
        else if (k == 2)
            printf("2");
        else
        {
            for (int i = 3; i <= k; i++)
            {
                c = a + b * 2;
                a = b;
                b = c;
            }
            printf("%d", c);
        }
    }